/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyivtbinventa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyivtbinventa.findAll", query = "SELECT p FROM Pyivtbinventa p"),
    @NamedQuery(name = "Pyivtbinventa.findByPyivtbinventaid", query = "SELECT p FROM Pyivtbinventa p WHERE p.pyivtbinventaid = :pyivtbinventaid"),
    @NamedQuery(name = "Pyivtbinventa.findByDescripcion", query = "SELECT p FROM Pyivtbinventa p WHERE p.descripcion = :descripcion"),
    @NamedQuery(name = "Pyivtbinventa.findByMarca", query = "SELECT p FROM Pyivtbinventa p WHERE p.marca = :marca"),
    @NamedQuery(name = "Pyivtbinventa.findByModelo", query = "SELECT p FROM Pyivtbinventa p WHERE p.modelo = :modelo"),
    @NamedQuery(name = "Pyivtbinventa.findBySerie", query = "SELECT p FROM Pyivtbinventa p WHERE p.serie = :serie"),
    @NamedQuery(name = "Pyivtbinventa.findByValorpresup", query = "SELECT p FROM Pyivtbinventa p WHERE p.valorpresup = :valorpresup"),
    @NamedQuery(name = "Pyivtbinventa.findByValoradqu", query = "SELECT p FROM Pyivtbinventa p WHERE p.valoradqu = :valoradqu"),
    @NamedQuery(name = "Pyivtbinventa.findByMaterialpred", query = "SELECT p FROM Pyivtbinventa p WHERE p.materialpred = :materialpred"),
    @NamedQuery(name = "Pyivtbinventa.findByNumerofactura", query = "SELECT p FROM Pyivtbinventa p WHERE p.numerofactura = :numerofactura"),
    @NamedQuery(name = "Pyivtbinventa.findByFechacompra", query = "SELECT p FROM Pyivtbinventa p WHERE p.fechacompra = :fechacompra"),
    @NamedQuery(name = "Pyivtbinventa.findByCaracteristicas", query = "SELECT p FROM Pyivtbinventa p WHERE p.caracteristicas = :caracteristicas"),
    @NamedQuery(name = "Pyivtbinventa.findByRefactaentrega", query = "SELECT p FROM Pyivtbinventa p WHERE p.refactaentrega = :refactaentrega"),
    @NamedQuery(name = "Pyivtbinventa.findByCodbien", query = "SELECT p FROM Pyivtbinventa p WHERE p.codbien = :codbien"),
    @NamedQuery(name = "Pyivtbinventa.findByFecharegistro", query = "SELECT p FROM Pyivtbinventa p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyivtbinventa.findByObservaciones", query = "SELECT p FROM Pyivtbinventa p WHERE p.observaciones = :observaciones")})
public class Pyivtbinventa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyivtbinventaid")
    private Integer pyivtbinventaid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "marca")
    private String marca;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "modelo")
    private String modelo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 25)
    @Column(name = "serie")
    private String serie;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valorpresup")
    private double valorpresup;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valoradqu")
    private double valoradqu;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "materialpred")
    private String materialpred;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "numerofactura")
    private String numerofactura;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechacompra")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechacompra;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "caracteristicas")
    private String caracteristicas;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "refactaentrega")
    private String refactaentrega;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 16)
    @Column(name = "codbien")
    private String codbien;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyivtbinventaid")
    private Collection<Pyivtbtrasinv> pyivtbtrasinvCollection;
    @JoinColumn(name = "scittbescunid", referencedColumnName = "scittbescunid")
    @ManyToOne(optional = false)
    private Scittbescun scittbescunid;
    @JoinColumn(name = "pyivtbusobienid", referencedColumnName = "pyivtbusobienid")
    @ManyToOne(optional = false)
    private Pyivtbusobien pyivtbusobienid;
    @JoinColumn(name = "pyivtbestabienid", referencedColumnName = "pyivtbestabienid")
    @ManyToOne(optional = false)
    private Pyivtbestabien pyivtbestabienid;
    @JoinColumn(name = "pyivtbcolorid", referencedColumnName = "pyivtbcolorid")
    @ManyToOne(optional = false)
    private Pyivtbcolor pyivtbcolorid;
    @JoinColumn(name = "pydgtbactivpoaid", referencedColumnName = "pyfntbactivpoaid")
    @ManyToOne(optional = false)
    private Pyfntbactivpoa pydgtbactivpoaid;

    public Pyivtbinventa() {
    }

    public Pyivtbinventa(Integer pyivtbinventaid) {
        this.pyivtbinventaid = pyivtbinventaid;
    }

    public Pyivtbinventa(Integer pyivtbinventaid, String descripcion, String marca, String modelo, String serie, double valorpresup, double valoradqu, String materialpred, String numerofactura, Date fechacompra, String caracteristicas, String refactaentrega, String codbien, Date fecharegistro, String observaciones) {
        this.pyivtbinventaid = pyivtbinventaid;
        this.descripcion = descripcion;
        this.marca = marca;
        this.modelo = modelo;
        this.serie = serie;
        this.valorpresup = valorpresup;
        this.valoradqu = valoradqu;
        this.materialpred = materialpred;
        this.numerofactura = numerofactura;
        this.fechacompra = fechacompra;
        this.caracteristicas = caracteristicas;
        this.refactaentrega = refactaentrega;
        this.codbien = codbien;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
    }

    public Integer getPyivtbinventaid() {
        return pyivtbinventaid;
    }

    public void setPyivtbinventaid(Integer pyivtbinventaid) {
        this.pyivtbinventaid = pyivtbinventaid;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getMarca() {
        return marca;
    }

    public void setMarca(String marca) {
        this.marca = marca;
    }

    public String getModelo() {
        return modelo;
    }

    public void setModelo(String modelo) {
        this.modelo = modelo;
    }

    public String getSerie() {
        return serie;
    }

    public void setSerie(String serie) {
        this.serie = serie;
    }

    public double getValorpresup() {
        return valorpresup;
    }

    public void setValorpresup(double valorpresup) {
        this.valorpresup = valorpresup;
    }

    public double getValoradqu() {
        return valoradqu;
    }

    public void setValoradqu(double valoradqu) {
        this.valoradqu = valoradqu;
    }

    public String getMaterialpred() {
        return materialpred;
    }

    public void setMaterialpred(String materialpred) {
        this.materialpred = materialpred;
    }

    public String getNumerofactura() {
        return numerofactura;
    }

    public void setNumerofactura(String numerofactura) {
        this.numerofactura = numerofactura;
    }

    public Date getFechacompra() {
        return fechacompra;
    }

    public void setFechacompra(Date fechacompra) {
        this.fechacompra = fechacompra;
    }

    public String getCaracteristicas() {
        return caracteristicas;
    }

    public void setCaracteristicas(String caracteristicas) {
        this.caracteristicas = caracteristicas;
    }

    public String getRefactaentrega() {
        return refactaentrega;
    }

    public void setRefactaentrega(String refactaentrega) {
        this.refactaentrega = refactaentrega;
    }

    public String getCodbien() {
        return codbien;
    }

    public void setCodbien(String codbien) {
        this.codbien = codbien;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyivtbtrasinv> getPyivtbtrasinvCollection() {
        return pyivtbtrasinvCollection;
    }

    public void setPyivtbtrasinvCollection(Collection<Pyivtbtrasinv> pyivtbtrasinvCollection) {
        this.pyivtbtrasinvCollection = pyivtbtrasinvCollection;
    }

    public Scittbescun getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Scittbescun scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Pyivtbusobien getPyivtbusobienid() {
        return pyivtbusobienid;
    }

    public void setPyivtbusobienid(Pyivtbusobien pyivtbusobienid) {
        this.pyivtbusobienid = pyivtbusobienid;
    }

    public Pyivtbestabien getPyivtbestabienid() {
        return pyivtbestabienid;
    }

    public void setPyivtbestabienid(Pyivtbestabien pyivtbestabienid) {
        this.pyivtbestabienid = pyivtbestabienid;
    }

    public Pyivtbcolor getPyivtbcolorid() {
        return pyivtbcolorid;
    }

    public void setPyivtbcolorid(Pyivtbcolor pyivtbcolorid) {
        this.pyivtbcolorid = pyivtbcolorid;
    }

    public Pyfntbactivpoa getPydgtbactivpoaid() {
        return pydgtbactivpoaid;
    }

    public void setPydgtbactivpoaid(Pyfntbactivpoa pydgtbactivpoaid) {
        this.pydgtbactivpoaid = pydgtbactivpoaid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyivtbinventaid != null ? pyivtbinventaid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyivtbinventa)) {
            return false;
        }
        Pyivtbinventa other = (Pyivtbinventa) object;
        if ((this.pyivtbinventaid == null && other.pyivtbinventaid != null) || (this.pyivtbinventaid != null && !this.pyivtbinventaid.equals(other.pyivtbinventaid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyivtbinventa[ pyivtbinventaid=" + pyivtbinventaid + " ]";
    }
    
}
